import request from "@/utils/request";
import { indexUrl } from "./url";

export async function getTopData() {
  return request({
    url: `${indexUrl}/totalTop`,
    method: "GET",
  });
  /*  return {
    success: true,
    message: "",
    code: 200,
    result: {
      releaseTotal: 14,
      kpiTotal: 1799,
    },
    timestamp: 1734594424290,
  };*/
}
export async function getLeftTreeData() {
  return request({
    url: `${indexUrl}/leftTree`,
    method: "GET",
  });
  /*  return {
    success: true,
    message: "",
    code: 200,
    result: {
      kpiClassifyList: [
        {
          title: "联网通信",
          classCode: "100000000000",
          total: 6,
          children: [
            {
              title: "移动联网",
              classCode: "101000000000",
              total: 1,
              children: null,
            },
            {
              title: "宽带联网",
              classCode: "102000000000",
              total: 1,
              children: null,
            },
            {
              title: "电视联网",
              classCode: "103000000000",
              total: 1,
              children: null,
            },
            {
              title: "专线联网",
              classCode: "104000000000",
              total: 1,
              children: null,
            },
            {
              title: "通信业务",
              classCode: "105000000000",
              total: 1,
              children: null,
            },
            {
              title: "信息业务",
              classCode: "106000000000",
              total: 1,
              children: null,
            },
          ],
        },
        {
          title: "算网数智",
          classCode: "200000000000",
          total: 6,
          children: [
            {
              title: "联通云",
              classCode: "201000000000",
              total: 1,
              children: null,
            },
            {
              title: "数据中心",
              classCode: "202000000000",
              total: 1,
              children: null,
            },
            {
              title: "数科集成",
              classCode: "203000000000",
              total: 1,
              children: null,
            },
            {
              title: "数据服务",
              classCode: "204000000000",
              total: 1,
              children: null,
            },
            {
              title: "数智应用",
              classCode: "205000000000",
              total: 1,
              children: null,
            },
            {
              title: "网信安全业务",
              classCode: "206000000000",
              total: 1,
              children: null,
            },
          ],
        },
      ],
      kpiCycleList: [
        {
          kpiCycle: "D",
          total: 4,
          title: "日指标",
        },
        {
          kpiCycle: "M",
          total: 10,
          title: "月指标",
        },
      ],
    },
    timestamp: 1734594824571,
  };*/
}
export async function getTheadList() {
  return request({
    url: `${indexUrl}/tableDataThead/1311295145400868861`,
    method: "GET",
  });
  /*  return {
    success: true,
    message: "",
    code: 200,
    result: [
      {
        id: "1311295145400868862",
        pid: "1311295145400868861",
        field: "kpiCode",
        fieldName: "指标编码",
        isShow: 1,
        orderNum: 1,
      },
      {
        id: "1311295145400868863",
        pid: "1311295145400868861",
        field: "kpiName",
        fieldName: "指标名称",
        isShow: 1,
        orderNum: 2,
      },
      {
        id: "1311295145400868864",
        pid: "1311295145400868861",
        field: "kpiTypeName",
        fieldName: "指标类型",
        isShow: 1,
        orderNum: 3,
      },
      {
        id: "1311295145400868865",
        pid: "1311295145400868861",
        field: "kpiCycle",
        fieldName: "指标周期",
        isShow: 1,
        orderNum: 4,
      },
      {
        id: "1311295145400868866",
        pid: "1311295145400868861",
        field: "releaseTime",
        fieldName: "发布时间",
        isShow: 1,
        orderNum: 5,
      },
      {
        id: "1311295145400868867",
        pid: "1311295145400868861",
        field: "addDate",
        fieldName: "上架时间",
        isShow: 1,
        orderNum: 6,
      },
      {
        id: "1311295145400868868",
        pid: "1311295145400868861",
        field: "technologyDesc",
        fieldName: "技术口径",
        isShow: 0,
        orderNum: 7,
      },
      {
        id: "1311295145400868869",
        pid: "1311295145400868861",
        field: "busiDesc",
        fieldName: "业务口径",
        isShow: 0,
        orderNum: 8,
      },
      {
        id: "1311295145400868870",
        pid: "1311295145400868861",
        field: "className",
        fieldName: "指标分类",
        isShow: 0,
        orderNum: 9,
      },
    ],
    timestamp: 1734593779394,
  };*/
}
export async function getTbodyData(params) {
  console.log(params, "查询参数");
  return request({
    url: `${indexUrl}/list`,
    method: "POST",
    data: params,
  });
  /* return {
    success: true,
    message: "",
    code: 200,
    result: {
      records: [
        {
          kpiCode: "c_0013",
          kpiName: "测试tes13",
          kpiTypeCode: "1002",
          kpiTypeName: "分析指标",
          kpiCycle: "M",
          busiDesc: "测试你好啊我我我4",
          technologyDesc: "test111测试你好啊我我我",
          releaseTime: "每月21日12:24",
          addDate: "20240118",
          busiType: "1002",
          classLv1Code: "300000000000",
          classLv1Name: "其他",
          classLv2Code: "301000000000",
          classLv2Name: "其他业务",
          sceneCode: "10000002",
          sceneName: "终端卡位",
          monthId: null,
          dayId: null,
        },
        {
          kpiCode: "c_0012",
          kpiName: "测试tes12",
          kpiTypeCode: "1002",
          kpiTypeName: "分析指标",
          kpiCycle: "M",
          busiDesc: "测试你好啊我我我4",
          technologyDesc: "test111测试你好啊我我我",
          releaseTime: "每月21日12:24",
          addDate: "20240118",
          busiType: "1002",
          classLv1Code: "300000000000",
          classLv1Name: "其他",
          classLv2Code: "301000000000",
          classLv2Name: "其他业务",
          sceneCode: "10000002",
          sceneName: "终端卡位",
          monthId: null,
          dayId: null,
        },
      ],
      total: 14,
      size: 2,
      current: 1,
      orders: [],
      optimizeCountSql: true,
      searchCount: true,
      maxLimit: null,
      countId: null,
      pages: 7,
    },
    timestamp: 1734596515645,
  };*/
}
export async function getUserDetailData(params) {
  console.log(params, "查询参数");
  return request({
    url: `${indexUrl}/userTableData`,
    method: "POST",
    data: params,
  });
  /*  return {
    success: true,
    message: "",
    code: 200,
    result: {
      total: 200,
      records: [
        {
          id: "1",
          month: "2025-02",
          date: "2025-02-31 12:12:00",
          userName: "sddssd",
          realName: "dssdfsfd",
          provName: "55666",
          cityName: "26215514",
          dialogFlag: "0",
          title: "ssdsdddssd",
          tenantId: "26215514",
          tenantName: "26215514",
        },
        {
          id: "2",
          month: "2025-02",
          date: "2025-02-31 12:12:00",
          userName: "sddssd",
          realName: "dssdfsfd",
          provName: "55666",
          cityName: "26215514",
          dialogFlag: "0",
          title: "ssdsdddssd",
          tenantId: "26215514",
          tenantName: "26215514",
        },
      ],
    },
  };*/
}
export async function deleteDimValue(params) {
  console.log(params, "查询参数");
  return request({
    url: `${indexUrl}/deletdimValue`,
    method: "POST",
    data: params,
  });
  /*    return {
    success: true,
    message: "",
    code: 200,
    result: ""
  };*/
}
